<template>
	<view class="notice">
		<template v-if="dataList[0]">
			<u-cell-group :border="false">
				<view class="cell_item" v-for="(item, index) in dataList" :key="index" :index="index">
					<u-cell-item @click="changecontent(index)" :border-bottom="false" :icon-style="{ color: '#999' }">
						<template slot="title">
							<u-icon name="volume-up-fill"></u-icon>
							<text class="title">{{ item.name }}</text>
						</template>
					</u-cell-item>
				</view>
			</u-cell-group>
		</template>
		<template v-else>
			<view class="empty">
				<u-empty text="暂无数据" mode="list"></u-empty>
			</view>
		</template>
	</view>
</template>

<script>
	import { pageShare } from '@/mixins/pageShare';
export default {
	mixins:[pageShare],
	data() {
		return {
			dataList: [],
			content: ''
		};
	},
	onLoad() {
		this.initData();
	},
	onShareAppMessage: function() {
		return this.getShareAppMessage();
	},
	onShareTimeline: function() {
		return this.getShareTimeline();
	},
	methods: {
		initData() {
			this.$resPost('GetInfotainmentList', { type: 1 }).then(res => {
				this.dataList = res.data;
			});
		},
		changecontent(data) {
			this.$linkTo(`/package/league/detail/index?id=${this.dataList[data].pk_id}`, 'navigatorTo');
		}
	}
};
</script>

<style lang="scss" scoped>
.notice {
	padding: 0 30rpx;
	.title {
		margin-left: 20rpx;
	}
	.content {
		padding: 0 30rpx;
	}
}
.cell_item {
	border-bottom: 1px solid #f5f5f5;
}

.empty {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

</style>
